[MINIOS] Move initialisation of events (masking event channels)
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 17 Nov 2006 09:16:27 +0000 (09:16 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 17 Nov 2006 09:16:27 +0000 (09:16 +0000)
earlier during the boot process. Otherwise 64bit guests would
sometimes crash.

Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
extras/mini-os/include/x86/os.h
extras/mini-os/kernel.c
extras/mini-os/mm.c

index eed5bda7c84b4b9d81b2c49d18f420aca537a621..80f5586a49ee223306b4515040e9515ec5fbcdb9 100644 (file)
@@ -19,6 +19,8 @@
 #include <types.h>
 #include <hypervisor.h>
 
+#define USED    __attribute__ ((used))
+
 extern void do_exit(void);
 #define BUG do_exit
 
index 72fc65ae1ed9d8040f29a7a512198aed63b6c4d5..9b3c471fe7981054b7bf1e319b2f3a40a2ab8461 100644 (file)
@@ -116,6 +116,9 @@ void start_kernel(start_info_t *si)
     printk("  cmd_line:   %s\n",  
            si->cmd_line ? (const char *)si->cmd_line : "NULL");
 
+    /* Set up events. */
+    init_events();
+    
     arch_print_info();
 
     setup_xen_features();
@@ -123,9 +126,6 @@ void start_kernel(start_info_t *si)
     /* Init memory management. */
     init_mm();
 
-    /* Set up events. */
-    init_events();
-    
     /* Init time and timers. */
     init_time();
 
index 03fb3e9ab5ecf132070de780bd4ca4cffe44109f..85f9e92216ecbb03d75e61843097c6a0fff4640a 100644 (file)
@@ -148,7 +148,7 @@ static chunk_head_t  free_tail[FREELIST_SIZE];
  * Prints allocation[0/1] for @nr_pages, starting at @start
  * address (virtual).
  */
-static void print_allocation(void *start, int nr_pages)
+USED static void print_allocation(void *start, int nr_pages)
 {
     unsigned long pfn_start = virt_to_pfn(start);
     int count;
@@ -163,7 +163,7 @@ static void print_allocation(void *start, int nr_pages)
  * Prints chunks (making them with letters) for @nr_pages starting
  * at @start (virtual).
  */
-static void print_chunks(void *start, int nr_pages)
+USED static void print_chunks(void *start, int nr_pages)
 {
     char chunks[1001], current='A';
     int order, count;
@@ -408,7 +408,6 @@ void new_pt_frame(unsigned long *pt_pfn, unsigned long prev_l_mfn,
          do_exit();
          break;
     }
-
     /* Update the entry */
 #if defined(__x86_64__)
     tab = pte_to_virt(tab[l4_table_offset(pt_page)]);
@@ -446,7 +445,6 @@ void new_pt_frame(unsigned long *pt_pfn, unsigned long prev_l_mfn,
        printk("ERROR: mmu_update failed\n");
        do_exit();
     }
-
     *pt_pfn += 1;
 }
 
@@ -581,7 +579,6 @@ void build_pagetable(unsigned long *start_pfn, unsigned long *max_pfn)
         }
         start_address += PAGE_SIZE;
     }
-
     *start_pfn = pt_pfn;
 }